2020-2021 Sunseeker Telemetry and Lighting System
eusci_a_spi_ex1_master.c File Reference
#include "driverlib.h"

Go to the source code of this file.

Functions

void main (void)
 
void USCI_A0_ISR (void)
 

Variables

uint8_t RXData =0
 
uint8_t TXData = 0
 

Function Documentation

◆ main()

void main ( void  )

◆ USCI_A0_ISR()

void USCI_A0_ISR ( void  )

Definition at line 200 of file eusci_a_spi_ex1_master.c.

References __delay_cycles(), RXData, and TXData.

Variable Documentation

◆ RXData

uint8_t RXData =0

USCI_A0, SPI 3-Wire Master Incremented Data This example shows how SPI master talks to SPI slave using 3-wire mode. Incrementing data is sent by the master starting at 0x01. Received data is expected to be same as the previous transmission. eUSCI RX ISR is used to handle communication with the CPU, normally in LPM0. If high, P1.0 indicates valid data reception. Because all execution after LPM0 is in ISRs, initialization waits for DCO to stabilize against ACLK. ACLK = ~32.768kHz, MCLK = SMCLK = DCO ~ 1048kHz. BRCLK = SMCLK/2

Use with eusci_spi_ex1_slave code example. If slave is in debug mode, P1.1 slave reset signal conflicts with slave's JTAG; to work around, use IAR's "Release JTAG on Go" on slave device. If breakpoints are set in slave RX ISR, master must stopped also to avoid overrunning slave RXBUF.


/|\ | | | | | Master—+->|RST | | | | P2.0|-> Data Out (UCA0SIMO) | | | P2.1|<- Data In (UCA0SOMI) | | | P1.5|-> Serial Clock Out (UCA0CLK)

This example uses the following peripherals and I/O signals. You must review these and change as needed for your own board:

  • SPI peripheral
  • GPIO Port peripheral (for SPI pins)
  • UCA0SIMO
  • UCA0SOMI
  • UCA0CLK

This example uses the following interrupt handlers. To use this example in your own application you must add these interrupt handlers to your vector table.

  • USCI_A0_VECTOR

Definition at line 77 of file eusci_a_spi_ex1_master.c.

◆ TXData

uint8_t TXData = 0

Definition at line 78 of file eusci_a_spi_ex1_master.c.